#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/un.h> //needed ?

int main(int argc, char **argv) {

	if(mkfifo("/tmp/rfcomm0",006)){
		printf("Error opening FIFO: %s\n", strerror(errno));
		//exit(1);
	}
	if(mkfifo("/tmp/rfcomm0Rx",006)){
		printf("Error opening FIFO: %s\n", strerror(errno));
		//exit(1);
	}

	if(symlink("/tmp/rfcomm0","/dev/tty.bluetooth")){
		printf("Error symlinking FIFO: %s\n", strerror(errno));
		//exit(1);
	}
	if(symlink("/tmp/rfcomm0Rx","/dev/tty.bluetooth")){
		printf("Error symlinking FIFO: %s\n", strerror(errno));
		//exit(1);
	}

	return 0;
}

